<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\ConfigGroup
 *
 * @property int $id
 * @property string $name 名称
 * @property int $sort 排序
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Configuration[] $configurations
 * @property-read int|null $configurations_count
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ConfigGroup whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class ConfigGroup extends Model
{
    protected $table = 'config_group';
    protected $fillable = ['name','sort'];

    //配置项
    public function configurations()
    {
        return $this->hasMany('App\Models\Configuration','group_id','id');
    }
}
